package com.ayf.payment.game.api.controller.paychannel;


import com.ayf.payment.game.api.SiteStatisticsRemoteService;
import com.ayf.payment.game.api.dto.SiteStatisticsSummaryDTO;
import com.ayf.payment.game.api.dto.criteria.SiteStatisticsCriteria;
import com.ayf.payment.game.api.type.CommonConstants;
import com.ayf.payment.game.api.utils.CommonResult;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RequestMapping("/t/site/statistics")
@RestController
public class OperatorSiteStatisticsController {

    @Reference(group = "xygpay-rpc-statistics",version = "${XY_STATISTICS_DUBBO_VERSION}")
    private SiteStatisticsRemoteService siteStatisticsRemoteService;

    /**
     * 站点统计查询列表
     * @param criteria
     * @return
     */
    @PostMapping("/list")
    public CommonResult<SiteStatisticsSummaryDTO> list(@RequestBody SiteStatisticsCriteria criteria) {
        SiteStatisticsSummaryDTO siteStatisticsSummaryDTO = siteStatisticsRemoteService.list(criteria);
        return new CommonResult<>(CommonConstants.RETURN_SUCCESS, "站点统计列表查询成功",siteStatisticsSummaryDTO);
    }
}
